package com.kinyx.framework.log;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * 日志（log4j2实现类）
 */
public final class Log4log4j2 extends Log {

	/** 日志对象 */
	private final Logger logger;

	/**
	 * 构造方法
	 * @param clazz 输出日志所在的类类型
	 */
	protected Log4log4j2(final Class<?> clazz) {
		super(clazz);
		this.logger = LogManager.getLogger(clazz);
	}

	@Override
	public boolean isTraceEnabled() { return this.logger.isTraceEnabled(); }
	@Override
	public boolean isDebugEnabled() { return this.logger.isDebugEnabled(); }
	@Override
	public boolean isInfoEnabled() { return this.logger.isInfoEnabled(); }
	@Override
	public boolean isWarnEnabled() { return this.logger.isWarnEnabled(); }
	@Override
	public boolean isErrorEnabled() { return this.logger.isErrorEnabled(); }
	@Override
	public boolean isFatalEnabled() { return this.logger.isFatalEnabled(); }

	@Override
	public void trace(final Object message) { this.logger.trace(message); }
	@Override
	public void debug(final Object message) { this.logger.debug(message); }
	@Override
	public void info(final Object message) { this.logger.info(message); }
	@Override
	public void warn(final Object message) { this.logger.warn(message); }
	@Override
	public void error(final Object message) { this.logger.error(message); }
	@Override
	public void fatal(final Object message) { this.logger.fatal(message); }

	@Override
	public void trace(final Object message, final Throwable t) { this.logger.trace(message, t); }
	@Override
	public void debug(final Object message, final Throwable t) { this.logger.debug(message, t); }
	@Override
	public void info(final Object message, final Throwable t) { this.logger.info(message, t); }
	@Override
	public void warn(final Object message, final Throwable t) { this.logger.warn(message, t); }
	@Override
	public void error(final Object message, final Throwable t) { this.logger.error(message, t); }
	@Override
	public void fatal(final Object message, final Throwable t) { this.logger.fatal(message, t); }

}
